package com.cuitrip.presenter;

import android.view.View;
import android.widget.TextView;

import com.cuitrip.app.base.PartViewHolder;
import com.cuitrip.service.R;
import com.lab.utils.NumberUtils;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by baziii on 15/8/10.
 */
public class RefundInfoViewHolder implements PartViewHolder<FeeRenderData> {
    public static final int RES = R.layout.ct_service_part_little;
//    @Bind(R.id.payed_layout)
//    ItemLayout mPayLayout;
//    @Bind(R.id.cut_layout)
//    ItemLayout mCutLayout;
//    @Bind(R.id.return_layout)
//    ItemLayout mReturnLayout;

    @Bind(R.id.money_type)
    TextView moneyType;

    @Bind(R.id.refund_fee)
    TextView refundFee;

    @Bind(R.id.total_pay)
    TextView totalPay;

    @Bind(R.id.cancellation_fee)
    TextView cancellationFee;

    public void build(View view) {
        ButterKnife.bind(this, view);
    }
    
    public void render(FeeRenderData data) {
        /*SpannableString spannableString = new SpannableString("");
        if (!TextUtils.isEmpty(UserConfig.getSettingMoneyType())) {
            spannableString = SpanUtil.getColorSpanString(R.color.orange_ff755a, UserConfig.getSettingMoneyType().toUpperCase() + " ");
        }

        mPayLayout.setmRightText(new SpannableStringBuilder(spannableString).append(data.orderPrice));
        mCutLayout.setmRightText(new SpannableStringBuilder(spannableString).append(data.penalty));
        mReturnLayout.setmRightText(new SpannableStringBuilder(spannableString).append(data.refund));*/
       // moneyType.setText();
        refundFee.setText(NumberUtils.getMoneyFormat(data.refund));
        totalPay.setText(NumberUtils.getMoneyFormat(data.orderPrice));
        cancellationFee.setText("- " + NumberUtils.getMoneyFormat(data.penalty));
    }
}
